<%@ page pageEncoding="utf-8"%> 
<%@page import="com.course.db.*"%>

<%  
	String path = request.getContextPath();  
	String basePath = request.getScheme()+"://"+request.getServerName()+
		(request.getServerPort() == 80 ? "" : (":"+request.getServerPort())) +path+"/";  
	String   userName   =   (String)session.getAttribute("userName");
	String   userType   =   (String)session.getAttribute("userType");
	String 	 menus=(String)session.getAttribute("menus");
	CourseBasic course = (CourseBasic)session.getAttribute("CourseEdit");
	//session.removeAttribute("CheckCourse");
%>

<script type="text/javascript">
	var base_path = "<%=basePath%>";
	var user_name="<%=userName%>";
	var user_type="<%=userType%>";
	var menus="<%=menus%>";

	function closebox(){ 
		   this.parent.Popup.prototype.reset_m(); //会刷新父页面
	} 
</script>
<base href="<%=basePath%>">
<%
	request.setAttribute("page_title","温岭选课系统-设置当前学期");
%>
<link rel="stylesheet" href="css/text.css" />
<link rel="stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/style.css" />
<style>
	table{
		margin:0;
		padding:0;
		border-collapse:collapse;
		border:0;
		cellpadding:0;
		cellspacing:0; 
		width:100%;
		//height:100%;
	}
	
	td{
		text-align:center;
		vertical-align:middle;
		line-height:30px;
		font-size:13px;
		border-collapse:collapse;
		border:1px solid black;
		margin:0;
		padding:0;
	}

	.tdLeft{
		align:left;
		text-align:left;
		padding-left:20px;
		
	}
</style>

<script type='text/javascript'>
	function submitfile()
	{
	   document.termform.submit();
	   document.form1.Reset.disabled=true;
	   document.getElementById("ajaxResult").innerHTML="<font color=\"red\">数据提交中 </font><img src='./images/loading.gif'/>";
	}
	
	function getDate(i){     
		 var date=new Date();     
		 var month=date.getMonth()+1;     
		 var day=date.getDate();     
		     
		 if(month.toString().length == 1){  //或者用if (eval(month) <10) {month="0"+month}     
		     
		 month='0'+month;     
		 }     
		 if(day.toString().length == 1){     
		 day='0'+day;     
		 }     
		 if(i==0)
		 	return date.getFullYear()-1;
		 else if(i==1)
			return date.getFullYear();
		 else if(i==2)
				return date.getFullYear()+1;
		 else
				return date.getFullYear()+2;
	 }     
</script>
	
<div style="width:100%; margin:1px;text-align:center;margin-top:30px;margin-bottom:50px;">
 	<p style="border:0;font-size:14px;padding-bottom:10px;">
  		<b>当前学期</b>
	</p>
		<form action="./Admin/setTerm.do" name="termform" method="post">
		<table style="border:1px solid gray;margin-left:0%;width:90%;">
			<tr>
				<td id="term"></td>
				<td>
					&nbsp;&nbsp;&nbsp;&nbsp;
 					<input type="checkbox" name="term" value="第一学期" />第一学期&nbsp;&nbsp;
 					<input type="checkbox" name="term" value="第二学期" />第二学期&nbsp;&nbsp;
 					<input type="checkbox" name="term" value="第三学期" />第三学期&nbsp;&nbsp;
 					<input type="checkbox" name="term" value="第四学期" />第四学期&nbsp;&nbsp;
				</td>
			</tr>
		</table>
		<div id="btn" style="width:100%;align:right">
			<input type="reset" name="Reset" value="重置"  style="margin-left:58%;"/>&nbsp;&nbsp;&nbsp;&nbsp;
      		<input type="submit" value="提交">
		</div>
	</form>
	<script>
		var term = "<select style=\"width:80px;\" name=\"year\"><option value='"+getDate(0)+"'>"+getDate(0)+"年</option>";
		term = term + "<option value='"+getDate(1)+"'>"+getDate(1)+"年</option>";
		term = term + "<option value='"+getDate(2)+"'>"+getDate(2)+"年</option>";
		term = term + "<option value='"+getDate(3)+"'>"+getDate(3)+"年</option></select>";
		document.getElementById('term').innerHTML=term;
	</script>   
	 <div id="ajaxResult" style="margin-top:20px;">
				<!-- <img src='./images/loading.gif'/>	  -->
	</div>

</div>